package name.luojun.DBhelper.ORM.entity;
import java.util.LinkedHashMap;
import java.util.Map;
public abstract class IPartition {
	private Map<String, String> partitions = new LinkedHashMap<String, String>();
	public static final int Range = 0;
	public static final int Hash = 1;
	public static final int List = 2;
	/**
	 * example partition by range fill in is partitions.put("201310", "2013-11-01 00:00:00");
	 * <p>
	 * put all your partitions one by one
	 * 
	 * @param partitions
	 */
	public abstract void fillPartition(Map<String, String> partitions);
	/**
	 * @return Partition.Range 、 Partition.Hash or Partition.List
	 */
	public abstract int partitionType();
	public String getPartitionSql() {
		this.fillPartition(partitions);
		StringBuffer buf = new StringBuffer();
		switch (this.partitionType()) {
			case Range :
				break;
		}
		return buf.toString();
	}
}
